﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MyLib.MyBase.MyWeb;

namespace MyLoad.LoadStatic
{
    public class HeaderObject
    {
        public string Title = string.Empty;
        public string Image = string.Empty;
        public string Description = string.Empty;
        public string Link = string.Empty;
    }
    public class LHeader:MyLoadWeb
    {
        public HeaderObject mHeaderObj = new HeaderObject();
        public string FacebookHTML = string.Empty;
        public LHeader(string Title, string Image, string Description, string Link, string DNS, string FacebookHTML)
           {
               mHeaderObj.Title = Title;
               mHeaderObj.Image = Image;
               mHeaderObj.Description = Description;
               mHeaderObj.Link = Link;
               this.FacebookHTML = FacebookHTML;
           }

        public LHeader(MyASHX CurrentPage)
        {
            this.CurrentPage = CurrentPage;
            TemplatePath = "~/Templates/Static/Header.html";
            Init();
        }      
        // Hàm trả về chuỗi có chứa mã HTML
        protected override string BuildHTML()
        {
            try
            {
                return LoadTemplateByArray(TemplatePath, new string[] { mHeaderObj.Title, mHeaderObj.Image, mHeaderObj.Link, mHeaderObj.Description, FacebookHTML });
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
